global class AccountService{

  WebService static string searchbyPhoneandName(string name, string phone) {
  	  	
	    //check if there are any accounts with matching name or phone         
	    account[] accounts =   [Select a.name ,a.cleanphonetext__C from Account a  WHERE 
								(a.name = :name or a.cleanphonetext__C = :phone) and 
								(a.RecordType.Name='Local OOR Customer' and a.RecordType.SobjectType = 'Account' )];
	    string match='none';  
   		for(account a :accounts){
            if(a.cleanphonetext__C == phone){
                match = 'phone';
                break; //if phone match is found, stop looking further
            }
            else if(a.name == name){
                match = 'name';     
                break;
                }           
		}
		return match;
     
  }
   
}